Add patches to make sure the tests fail as soon as something goes wrong
authorSimon McVittie <smcv@debian.org>
Sat, 11 Jun 2016 18:54:30 +0000 (19:54 +0100)
committerSimon McVittie <smcv@debian.org>
Sat, 11 Jun 2016 18:54:30 +0000 (19:54 +0100)
debian/changelog
debian/patches/series
debian/patches/test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch [new file with mode: 0644]
debian/patches/tests-Use-strict-mode-by-default-for-C-tests.patch [new file with mode: 0644]

index 94cea7d40a559da7c3128fb424e4cd40d7557827..0fabf764cfd133f6315d7f6f89ee32640dc9fc29 100644 (file)
@@ -1,3 +1,11 @@
+ostree (2016.5-4) UNRELEASED; urgency=medium
+
+  * d/p/test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch,
+    d/p/tests-Use-strict-mode-by-default-for-C-tests.patch: add patches
+    to make sure the tests fail as soon as something goes wrong
+
+ -- Simon McVittie <smcv@debian.org>  Sat, 11 Jun 2016 19:52:40 +0100
+
 ostree (2016.5-3) unstable; urgency=medium
 
   * Remove ostree-grub2 and the boot-related parts of ostree, leaving
index 6fd880973a47d805ab6bc7e721def0bb47b5ee3f..865fdd1f8036bfbf067beb7b32026dd6ac78143d 100644 (file)
@@ -1,2 +1,4 @@
 libtest-show-files-contents-when-assertions-about-them-fa.patch
 test-parent-this-test-requires-user-xattrs.patch
+tests-Use-strict-mode-by-default-for-C-tests.patch
+test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch
diff --git a/debian/patches/test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch b/debian/patches/test-sysroot.js-set-strict-mode-when-sourcing-libtest.sh.patch
new file mode 100644 (file)
index 0000000..b31f765
--- /dev/null
@@ -0,0 +1,26 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Sat, 11 Jun 2016 19:07:40 +0100
+Subject: test-sysroot.js: set "strict mode" when sourcing libtest.sh
+
+As with the C tests in commit 08580118, this makes sure the test
+fails as soon as something goes wrong.
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+Forwarded: https://github.com/ostreedev/ostree/pull/335
+---
+ tests/test-sysroot.js | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test-sysroot.js b/tests/test-sysroot.js
+index 9468d2f..7c31659 100644
+--- a/tests/test-sysroot.js
++++ b/tests/test-sysroot.js
+@@ -37,7 +37,7 @@ function libtestExec(shellCode) {
+     let testdatadir = GLib.getenv("G_TEST_SRCDIR");
+     let libtestPath = GLib.build_filenamev([testdatadir, 'libtest.sh'])
+     let proc = GSystem.Subprocess.new_simple_argv(['bash', '-c',
+-                                                 '. ' + GLib.shell_quote(libtestPath) + '; ' + shellCode],
++                                                 'set -xeuo pipefail; . ' + GLib.shell_quote(libtestPath) + '; ' + shellCode],
+                                                 GSystem.SubprocessStreamDisposition.INHERIT,
+                                                 GSystem.SubprocessStreamDisposition.INHERIT,
+                                                 null);
diff --git a/debian/patches/tests-Use-strict-mode-by-default-for-C-tests.patch b/debian/patches/tests-Use-strict-mode-by-default-for-C-tests.patch
new file mode 100644 (file)
index 0000000..54d9f56
--- /dev/null
@@ -0,0 +1,37 @@
+From: Colin Walters <walters@verbum.org>
+Date: Mon, 6 Jun 2016 15:00:13 -0400
+Subject: tests: Use strict mode by default for C tests
+
+I was extending the C-based test suite to cover more, and noticed that
+we weren't aborting if a command failed.  That made the tests somewhat
+less useful, so let's fix it.
+
+Closes: #321
+Approved by: jlebon
+Origin: upstream, commit:085801185125893a53d7a65732c6832f875ed5d6
+---
+ tests/libostreetest.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/libostreetest.c b/tests/libostreetest.c
+index 5828336..a557ee3 100644
+--- a/tests/libostreetest.c
++++ b/tests/libostreetest.c
+@@ -40,7 +40,7 @@ run_libtest (const char *cmd, GError **error)
+   g_ptr_array_add (argv, "bash");
+   g_ptr_array_add (argv, "-c");
+-  g_string_append (cmdstr, ". ");
++  g_string_append (cmdstr, "set -xeuo pipefail; . ");
+   g_string_append (cmdstr, builddir);
+   g_string_append (cmdstr, "/tests/libtest.sh; ");
+   g_string_append (cmdstr, cmd);
+@@ -68,7 +68,7 @@ ot_test_setup_repo (GCancellable *cancellable,
+   g_autoptr(GFile) repo_path = g_file_new_for_path ("repo");
+   glnx_unref_object OstreeRepo* ret_repo = NULL;
+-  if (!run_libtest ("setup_test_repository", error))
++  if (!run_libtest ("setup_test_repository archive-z2", error))
+     goto out;
+   ret_repo = ostree_repo_new (repo_path);